feat(deps): upgrade ESLint and react-hooks with code fixes#153
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR upgrades the ESLint ecosystem (eslint 9.28.0→9.39.1, eslint-plugin-react-hooks 5.2.0→7.0.1, TypeScript ESLint 8.35.0→8.48.1) and applies code fixes to comply with updated linting rules. The changes focus on proper React hooks usage, removing unused variables, and improving state management patterns.
Key Changes:
- Upgraded ESLint and react-hooks plugin with new experimental rules disabled for gradual adoption
- Fixed React hooks ordering to ensure hooks are called before early returns
- Refactored state management to use useState initializers instead of useEffect for form initialization
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updated ESLint ecosystem packages to latest versions |
| package-lock.json | Lock file updates reflecting new package versions |
| eslint.config.js | Added configuration to disable new experimental React Compiler rules |
| src/panel.ts | Removed unused error parameter from catch block |
| src/hooks/useWebRTC.ts | Removed unused frame counting variables and fixed dependency array |
| src/components/widgets/WeatherWidget.tsx | Moved useMemo hook before early returns to comply with Rules of Hooks |
| src/components/tests/CardConfig.test.tsx | Removed unused fireEvent import |
| src/components/ScreenConfigDialog.tsx | Replaced useEffect with useState initializer for form state |
| src/components/LightCard.tsx | Extracted variables for useMemo dependencies to improve clarity |
| src/components/KeepAlive.tsx | Changed from useRef to useState to properly trigger re-renders |
| src/components/InputTextCard.tsx | Refactored to use computed values instead of useEffect for state sync |
| src/components/Dashboard.tsx | Added key prop to force ScreenConfigDialog remount |
| src/components/CameraCard.tsx | Prefixed unused parameter with underscore |
| src/components/BinarySensorCard.tsx | Moved useMemo hook before early returns |
| app/utils/responsive.ts | Removed redundant setState call before addEventListener |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
react-hooks/refs,react-hooks/static-components,react-hooks/set-state-in-effect,react-hooks/incompatible-library,react-hooks/preserve-manual-memoizationRelated
Supersedes Dependabot PR #152
Test plan
npm test)npm run lint)npm run typecheck)